function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;
//버튼 자국안생기게 해준당

function setPng24(obj)
{
    obj.width = obj.height = 1;
    obj.className = obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');";
    obj.src = '';
    return '';
}

//플래시 사이즈 변경
function large(){
 document.all['STATICMENU'].style.width = 355;
}
function small(){

 document.all['STATICMENU'].style.width = 36;
}


function OOpenWindow(url,intWidth,intHeight) {
      window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=1,scrollbars=1") ;
}
// javascript:OOpenWindow('vr/vr03.html','700','545')는 버튼에 넣어주는 센스


// 중앙팝업창띄우기
var UserBrowserWidth = window.screen.width ; //좌표설정
var UserBrowserHeight = window.screen.height ; //좌표설정
var OpenWinVal ;
function openWindow(filename,w,h,name,center,scrollbars)
{
  var StrOption ;

  StrOption  = "width=" + w + ",height=" + h + ",";
  StrOption += "toolbar=no,location=no,directories=no,status=no,";
  StrOption += "menubar=no,scrollbars=" + scrollbars + ",resizable=no";

  //if(OpenWinVal != null && !OpenWinVal.closed)
    //OpenWinVal.close() ;
  OpenWinVal = window.open(filename, name, StrOption) ;
  if(center == "yes") OpenWinVal.moveTo((UserBrowserWidth/2) - (w/2),(UserBrowserHeight/2) - (h/2)) ;
  return ;
}

//javascript: openWindow('link','640','600','r001','yes','no')


/*function RealReservation() {
  var url="http://www.pentour.com/real/index.php?pid=2835";
  open(url,'펜션예약하기','width=700,height=650,menubar=no,resizable=no,location=no,status=yes,scrollbars=yes,toolbar=no');
}*/
//펜션 실시간예약을 위한 스크립트
//<a href="javascript:RealReservation('reservation','reservation')" onFocus="this.blur()"></a>는 버튼앞에 넣어줘~잉
//pid만 변경 예약창 코드

//swf 자바
function swf_include(swfUrl,swfWidth,swfHeight,bgColor,mode,swfName,access,flashVars){
	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+swfWidth+"' height='"+swfHeight+"' id='"+swfName+"' align='middle' />"+
	"<param name='allowScriptAccess' value='"+access+"' />"+
	"<param name='movie' value='"+swfUrl+"' />"+
	"<param name='FlashVars' value='"+flashVars+"' />"+
	"<param name='loop' value='false' />"+
	"<param name='menu' value='true' />"+
	"<param name='quality' value='high' />"+
    "<param name='scale' value='noscale' />"+
	"<param name='bgcolor' value='"+bgColor+"' />"+
    "<param name='WMODE' value='"+mode+"'>"+
	"<embed src='"+swfUrl+"' FlashVars='"+flashVars+"'  quality='best' bgcolor='#EEF8FF' width='"+swfWidth+"' height='"+swfHeight+"' name='"+swfName+"' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);
};
/*
<script type="text/javascript">
<!--
swf_include("NetConnection & NetStream.swf","100%","100%","#000000","transparent","swf_name","sameDomain",null);
//-->
</script>
*/

function get_flash(URL,wid,hei,mode) {
	str = "";
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>";
	str += "<param name='movie' value='"+URL+"'>";
	str += "<param name='quality' value='high'>";
	str += "<param name='WMODE' value='"+mode+"'>";
	str += "<embed src='"+URL+"' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>";
	str += "</object>";

	document.write(str);
}
//이올라쑤패치  <script>get_flash('flash/navi.swf', 469,51, 'transparent')</script>

function get_flash2(URL,wid,hei,mode, vars) {
	str = "";
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>";
	str += "<param name='movie' value='"+URL+"'>";
	str += "<param name='quality' value='high'>";
	str += "<param name='WMODE' value='"+mode+"'>";
	str += "<param name='FlashVars' VALUE='"+vars+"'>";
	str += "<embed src='"+URL+"' FlashVars='"+vars+"' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>";
	str += "</object>";

	document.write(str);
}

function get_flash3(URL,wid,hei,mode, vars) {
	str = "";
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>";
	str += "<param name='movie' value='"+URL+"'>";
	str += "<param name='quality' value='high'>";
	str += "<param name='WMODE' value='"+mode+"'>";
	str += "<param name='FlashVars' VALUE='"+vars+"'>";
	str += "<embed src='"+URL+"' FlashVars='"+vars+"' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>";
	str += "</object>";

	document.write(str);
}


function get_flash4(URL,wid,hei,mode, vars, imgurl) {
	str = "";
	str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+wid+"' height='"+hei+"'>";
	str += "<param name='movie' value='"+URL+"'>";
	str += "<param name='quality' value='high'>";
	str += "<param name='WMODE' value='"+mode+"'>";
	str += "<param name='FlashVars' VALUE='"+vars+"&imgurl="+imgurl+"'>";
	str += "<embed src='"+URL+"' FlashVars='"+vars+"&imgurl="+imgurl+"' wmode='transparent' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+wid+"' height='"+hei+"'></embed>";
	str += "</object>";

	document.write(str);
}

//따라다니는메뉴

var stmnGAP1 = 630;
var stmnGAP2 = 100;
var stmnBASE = 600;
var stmnActivateSpeed = 200;
var stmnScrollSpeed = 10;
var stmnTimer;

function InitializeStaticMenu()
{
		/*
		if (ReadCookie("ANIMATE") == "false") {
				ANIMATE.checked = false;
				STATICMENU.style.top = document.body.scrollTop + stmnGAP1;
		}
		else {
				ANIMATE.checked = true;
				STATICMENU.style.top = document.body.scrollTop + stmnBASE;
				RefreshStaticMenu();
		}
		*/
		STATICMENU.style.top = document.body.scrollTop + stmnBASE;
		RefreshStaticMenu();
}

/*
function ReadCookie(name)
{
		var label = name + "=";
		var labelLen = label.length;
		var cLen = document.cookie.length;
		var i = 0;

		while (i < cLen) {
				var j = i + labelLen;

				if (document.cookie.substring(i, j) == label) {
						var cEnd = document.cookie.indexOf(";", j);
						if (cEnd == -1) cEnd = document.cookie.length;

						return unescape(document.cookie.substring(j, cEnd));
				}

				i++;
		}

		return "";
}
*/

function RefreshStaticMenu()
{
		var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

		stmnStartPoint = parseInt(STATICMENU.style.top, 10);
		stmnEndPoint = document.body.scrollTop + stmnGAP2;
		if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

		stmnRefreshTimer = stmnActivateSpeed;

		if ( stmnStartPoint != stmnEndPoint ) {
				stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
				STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
				stmnRefreshTimer = stmnScrollSpeed;
		}

		stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}

/*
function ToggleAnimate()
{
		if (ANIMATE.checked) {
				RefreshStaticMenu();
				SaveCookie("ANIMATE", "true", 300);
		}
		else {
				clearTimeout(stmnTimer);
				STATICMENU.style.top = stmnGAP1;
				SaveCookie("ANIMATE", "false", 300);
		}
}

function SaveCookie(name, value, expire)
{
		var eDate = new Date();
		eDate.setDate(eDate.getDate() + expire);
		document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}
*/
//-->

//따라댕기는 메뉴


function windown() {
   obj = new ActiveXObject("Shell.Application");
   obj.MinimizeAll();
}
function Show(divid) {
  divid.style.visibility = "visible";
}
function Hide(divid) {
  divid.style.visibility = "hidden";
}

function FieldCheck(field, msg) {
	if(!field.value) {
		alert(msg);
		field.focus();
		return true;
	}
	return false;
}

function OnlyNumber(obj) {
	for(var i=0; i<obj.value.length; i++) {
		var chr=obj.value.substr(i,1);
		if(chr<'0' || chr > '9') {
			alert('숫자만 입력가능합니다.');
			obj.focus();
			obj.select();
			return;
		}
	}
}